$(function(){var address=[];
    //同步获取数据
    $.ajax({
        type: "post",
        url:'/order/findAddress.do',
        async:false,
        success:function (data) {
            for (var i = 0; i< data.data.length ; i++){
                address.push(data.data[i]);
            }
        }
    });var hgS1=new selectSwiper({el:'.select_box1',data:address,init:function(index){if(index!==-1){$('.btn1').html(this.data[index]);}},okFunUndefind:function(){alert('必须选择一项');return false;},okFun:function(index){console.log(index);$('.btn1').html(this.data[index]);},closeFun:function(){console.log('取消');},});$('.btn1').on('click',function(){hgS1.openSelectSwiper();});var hgS2=new selectSwiper({el:'.select_box2',mustSelect:true,activeIndex:0,data:['哈哈2','呵呵2','嘻嘻2','嘿嘿2','呼呼2','咳咳2','嘘嘘2'],init:function(index){if(index!==-1){$('.btn2').html(this.data[index]);}},okFunUndefind:function(){alert('必须选择一项');},okFun:function(index){$('.btn2').html(this.data[index]);},closeFun:function(){console.log('取消');},});$('.btn2').on('click',function(){hgS2.openSelectSwiper();});
    var hgS3=new selectSwiper({
        el:'.select_box3',
        mustSelect:true,activeIndex:-1,
        data:address,
        init:function(index){
            if(index!==-1){
                $('.btn3').val(this.data[index]);
            }},
        okFunUndefind:function(){
            alert('必须选择一项');
            return false;},
        okFun:function(index){
            $('.btn3').val(this.data[index]);
            },
        closeFun:function(){
            console.log('取消');
            },
    });
    $('.btn3').on('click',function(){
        hgS3.openSelectSwiper();
    });
});